package com.jqq.enumeration_;

/**
 * @author 姬倩倩
 * @version 1.0
 */
public class Enumeration03 {
    public static void main(String[] args) {
        System.out.println(Season3.SPRING);
        System.out.println(Season3.SUMMER);
        System.out.println(Season3.AUTUMN);

    }
}
//演示enum关键字的使用
enum Season3{
    //如果使用了enum来实现枚举类
    //1. 使用关键字enum 替代 class
    //2. public final static Season2 SPRING= new Season2("春天","温暖");
    //   直接使用SPRING("春天", "温暖");替代
    //   常量名(实参列表)
    //3. 如果有多个常量(对象)，使用 , 间隔
    //4. 要求将定义的常量对象写在最前面
    SPRING("春天", "温暖"),
    SUMMER("夏天","炎热"),
    AUTUMN;
    private String name;
    private String desc;

    Season3(String name, String desc) {
        this.name = name;
        this.desc = desc;
    }

    Season3() {
    }

    @Override
    public String toString() {
        return "Season3{" +
                "name='" + name + '\'' +
                ", desc='" + desc + '\'' +
                '}';
    }
}